package cn.hou.java.designpattern._01factorycacl;

//创建运算类工厂
public class OperatorFactory {
	//返回运算类对象
	public static Operator getOperator(String oper){
		if(oper.equals("+")){
			return new AddOperator();
		}else if(oper.equals("-")){
			return new SubOperator();
		}else if(oper.equals("*")){
			return new MulOperator();
		}else if(oper.equals("/")){
			return new DivOperator();
		}else{
			System.out.println("目前不支持这种操作");
			return null;
		}
	}
}
